package wfmanage.action;

import java.util.ArrayList;
import java.util.Map;

import com.opensymphony.xwork2.ActionContext;
import com.util.MyLog;

import edu.wfmanage.models.Lookup;


public class DeleteLookup {
	private int lookup_id=0;
	int i=0;
	private String table="";
	private String name = "";
	private int is_current = 0;
	private String submit="";
	Lookup lookup =new Lookup();
    private ArrayList<Lookup> allValues = new ArrayList<Lookup>();
	public String execute() throws Exception {
		MyLog.log("In DeleteLookup.execute().......");
		Map session = ActionContext.getContext().getSession();
		session = ActionContext.getContext().getSession();
		table=(String)session.get("table");
		MyLog.log("session table"+session.get("table"));
		int i = Lookup.findOnefordelete(table,"where "+table+"_id = " + lookup_id);
		MyLog.log("lookup value deleted successfully");
		MyLog.log(lookup+" deleted successfully...!");
		this.allValues = Lookup.find(table,"");
		return "success";
		}
	public int getLookup_id() {
		return lookup_id;
	}
	public void setLookup_id(int lookup_id) {
		this.lookup_id = lookup_id;
	}
	public String getTable() {
		return table;
	}
	public void setTable(String table) {
		this.table = table;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public int getIs_current() {
		return is_current;
	}
	public void setIs_current(int is_current) {
		this.is_current = is_current;
	}
	public String getSubmit() {
		return submit;
	}
	public void setSubmit(String submit) {
		this.submit = submit;
	}
	public Lookup getLookup() {
		return lookup;
	}
	public void setLookup(Lookup lookup) {
		this.lookup = lookup;
	}
	public ArrayList<Lookup> getAllValues() {
		return allValues;
	}
	public void setAllValues(ArrayList<Lookup> allValues) {
		this.allValues = allValues;
	}
}
